#ifndef QUESTION_HPP_
#define QUESTION_HPP_

#include <QList>
#include <QObject>
#include <QSharedPointer>

#include "answer.hpp"


class Question : public QObject
{
	Q_OBJECT

	Q_PROPERTY(int questionID READ questionId)
	Q_PROPERTY(QString text READ text WRITE setText)
	Q_PROPERTY(QList<QSharedPointer<Answer> > answers READ answers WRITE setAnswers)
public:
	Question(const int id, const QString &text, const QList<QSharedPointer<Answer> > &answers, QObject *parent = 0);

	int questionId() const;
	QString text() const;
	QList<QSharedPointer<Answer> > answers() const;

	void setText(const QString &newText);
	void setAnswers(const QList<QSharedPointer<Answer> > &newAnswers);

	void addAnswer(QSharedPointer<Answer> answer);

private:
	int m_id;
	QString m_text;
	QList<QSharedPointer<Answer> > m_answers;
};


#endif /* QUESTION_HPP_ */
